package com.aspose.cells;

import java.util.ArrayList;

class zaum {
   private int a;
   private int b;
   private byte[] c = new byte[2];
   private byte[] d;
   private zauk e;
   private zpb f;
   private Worksheet g;
   private zbwo h;

   void a(zauk var1, Worksheet var2, zbwo var3) throws Exception {
      this.h = var3;
      zvh var4 = var3.b;
      zane var5 = var4.a().b("_SX_DB_CUR");
      if (var5 != null) {
         String var6 = com.aspose.cells.a.c.zp.d(var1.r);
         com.aspose.cells.b.a.d.zh var7 = var5.a(var6);
         if (var7 != null) {
            this.e = var1;
            var5.g(var6);
            this.g = var2;
            this.a(var7);
         }
      }
   }

   private void a(com.aspose.cells.b.a.d.zh var1) throws Exception {
      ArrayList var2 = new ArrayList();
      this.e.G = var2;
      this.f = new zpb(var1);

      while(true) {
         this.a = this.f.b(this.c);
         switch(this.a) {
         case 10:
            this.f.a(-2);
            return;
         default:
            this.b();
            com.aspose.cells.b.a.a.ze.a(var2, (Object)this.d);
         }
      }
   }

   private void b() throws Exception {
      this.h.a(this.f, this.a & '\uffff');
      this.d = this.h.a();
   }

   void b(zauk var1, Worksheet var2, zbwo var3) throws Exception {
      this.h = var3;
      zvh var4 = var3.b;
      zane var5 = var4.a().b("_SX_DB_CUR");
      if (var5 != null) {
         String var6 = com.aspose.cells.a.c.zp.d(var1.r);
         com.aspose.cells.b.a.d.zh var7 = var5.a(var6);
         if (var7 != null) {
            this.e = var1;
            var5.g(var6);
            this.g = var2;
            this.c();
            this.b(var7);
         }
      }
   }

   private String a(byte[] var1, int var2) throws Exception {
      int var3 = com.aspose.cells.b.a.zc.e(this.d, var2) & '\uffff';
      String var4 = null;
      if (var3 == 0) {
         return null;
      } else {
         var4 = zco.a(this.d, var2);
         return var4.charAt(0) == 2 ? var4.substring(1) : var4;
      }
   }

   private void c() throws Exception {
      if (this.e.z != null) {
         ArrayList var1 = new ArrayList();
         int var2 = 0;
         int var3 = 0;

         int var4;
         for(var4 = 0; var4 < this.e.z.size(); ++var4) {
            this.d = (byte[])((byte[])this.e.z.get(var4));
            this.a = com.aspose.cells.b.a.zc.e(this.d, 0);
            switch(this.a) {
            case 81:
               String var30 = this.a((byte[])this.d, 10);
               Worksheet var31 = var30 != null && !"".equals(var30) ? this.g.c().get(var30) : this.g;
               if (var31 == null) {
                  return;
               }

               int var9 = com.aspose.cells.b.a.zc.e(this.d, 4) & '\uffff';
               int var10 = com.aspose.cells.b.a.zc.e(this.d, 6) & '\uffff';
               int var11 = this.d[8] & 255;
               int var12 = this.d[9] & 255;
               Range var13 = new Range(var9, var11, var10 - var9 + 1, var12 - var11 + 1, this.g.getCells());
               String var14 = null;
               if (zakq.b(var31.getName())) {
                  var14 = "'" + var31.getName() + "'!" + var13.b();
               } else {
                  var14 = var31.getName() + "!" + var13.b();
               }

               zqr var15 = new zqr(this.e, var31, var14);
               var15.b = var13;
               var15.c = var13;
               com.aspose.cells.b.a.a.ze.a(var1, (Object)var15);
               break;
            case 82:
               byte var16 = 6;
               int[] var17 = new int[]{var16};
               String var18 = this.a(var17, this.d[4] & 255);
               int var32 = var17[0];
               if (var18.startsWith("=")) {
                  var18 = var18.substring(1);
               }

               String var19 = this.a(this.d, var32);
               boolean var20 = var19 == null || "".equals(var19);
               boolean var21 = false;
               Worksheet var22 = var20 ? this.g : this.g.c().get(var19);
               if (var22 == null) {
                  return;
               }

               int var23 = var20 ? -1 : var22.getIndex();
               Name var24 = this.g.c().getNames().a(var18, var23);
               Range var25 = null;
               if (var24 == null) {
                  var21 = true;
                  var24 = this.g.c().getNames().get(var18);
               }

               if (var24 == null) {
                  this.e.D = var18;
                  return;
               }

               var25 = var24.c(false);
               if (var21 && var25 != null) {
                  var22 = var25.getWorksheet();
               }

               this.e.D = var18;
               String var26 = var18;
               if (!var20) {
                  if (zakq.b(var22.getName())) {
                     var26 = "'" + var22.getName() + "'!" + var25.b();
                  } else {
                     var26 = var22.getName() + "!" + var25.b();
                  }
               }

               zqr var27 = null;
               if (var20) {
                  var27 = new zqr(this.e, (Worksheet)null, var26);
               } else {
                  var27 = new zqr(this.e, var22, var26);
               }

               var27.b = var25;
               var27.c = var25;
               com.aspose.cells.b.a.a.ze.a(var1, (Object)var27);
               if (var24 != null && var24.b() != null && var24.b()[2] != 59) {
                  return;
               }
               break;
            case 208:
               this.e.g = new int[com.aspose.cells.b.a.zc.b(this.d, 4)][];
               this.e.h = (this.d[9] & 255 & 128) != 0;
               if (!this.e.h) {
                  this.e.f = new String[com.aspose.cells.b.a.zc.b(this.d, 8)][];
               } else {
                  this.e.f = new String[1][];
               }
               break;
            case 209:
               String[] var29 = this.e.f[var3] = new String[com.aspose.cells.b.a.zc.e(this.d, 4)];
               ++var4;

               for(int var7 = 0; var7 < var29.length; ++var7) {
                  this.d = (byte[])((byte[])this.e.z.get(var4 + var7));
                  this.a = com.aspose.cells.b.a.zc.e(this.d, 0);
                  switch(this.a) {
                  case 201:
                     var29[var7] = com.aspose.cells.b.a.zn.b(com.aspose.cells.b.a.zc.f(this.d, 4));
                     break;
                  case 202:
                     var29[var7] = this.d[4] != 0 ? "TRUE" : "FALSE";
                  case 203:
                  case 204:
                  default:
                     break;
                  case 205:
                     String var8 = null;
                     if (this.d[6] == 0) {
                        var8 = Encoding.getASCII().a(this.d, 7, this.d.length - 7);
                     } else {
                        var8 = Encoding.getUnicode().a(this.d, 7, this.d.length - 7);
                     }

                     var29[var7] = var8;
                     break;
                  case 206:
                     var29[var7] = com.aspose.cells.b.a.zr.a(this.b(this.d, 4));
                     break;
                  case 207:
                     var29[var7] = null;
                  }
               }

               ++var3;
               var4 += var29.length - 1;
               break;
            case 210:
               int[] var5 = this.e.g[var2] = new int[(this.d.length - 4) / 2];

               for(int var6 = 0; var6 < var5.length; ++var6) {
                  var5[var6] = com.aspose.cells.b.a.zc.e(this.d, var6 * 2 + 4) & '\uffff';
               }

               ++var2;
               break;
            case 2148:
               byte[] var28 = new byte[this.d.length - 8];
               System.arraycopy(this.d, 8, var28, 0, var28.length);
               this.e.A.a(var28);
            }
         }

         this.e.z = null;
         if (var1.size() != 0) {
            this.e.e = new zqr[var1.size()];

            for(var4 = 0; var4 < var1.size(); ++var4) {
               this.e.e[var4] = (zqr)var1.get(var4);
            }
         }

      }
   }

   private String a(int[] var1, int var2) throws Exception {
      String var3 = null;
      if (this.d[var1[0]] == 0) {
         var3 = Encoding.getASCII().a(this.d, var1[0] + 1, var2);
         var1[0] += var2 + 1;
      } else {
         var3 = Encoding.getUnicode().a(this.d, var1[0] + 1, var2 * 2);
         var1[0] += var2 * 2 + 1;
      }

      return var3;
   }

   private void b(com.aspose.cells.b.a.d.zh var1) throws Exception {
      this.f = new zpb(var1);

      while(!this.f.a()) {
         this.a = this.f.b(this.c);
         switch(this.a) {
         case 10:
            this.f.a(2);
            return;
         case 198:
            this.e();
            this.e.k = com.aspose.cells.b.a.zc.a(this.d, 0);
            this.e.r = com.aspose.cells.b.a.zc.e(this.d, 4) & '\uffff';
            this.e.l = com.aspose.cells.b.a.zc.e(this.d, 6);
            this.e.y = com.aspose.cells.b.a.zc.e(this.d, 8) & '\uffff';
            this.e.i = com.aspose.cells.b.a.zc.e(this.d, 10) & '\uffff';
            this.e.j = com.aspose.cells.b.a.zc.e(this.d, 12) & '\uffff';
            this.e.d = (byte)(this.d[16] & 255);
            short var2 = com.aspose.cells.b.a.zc.b(this.d, 18);
            if (var2 != -1) {
               if (this.d[20] == 0) {
                  this.e.w = Encoding.getASCII().a(this.d, 21, this.d.length - 21);
               } else {
                  this.e.w = Encoding.getUnicode().a(this.d, 21, this.d.length - 21);
               }
            }
            break;
         case 199:
            this.f.a(-2);
            this.a();
            zbqs var7 = null;
            int var4 = 0;

            for(; var4 < this.e.p.size(); ++var4) {
               var7 = (zbqs)this.e.p.get(var4);
               boolean var8 = var7.c == null || var7.c.size() == 0;
               boolean var6 = var7.n() && var7.j != null && var7.j.d != null && var7.j.d.size() > 0;
               if (var8 && var6) {
                  var7.o = true;
                  var7.j.k = var7.i;
               }
            }
            break;
         case 200:
            this.f.a(-2);
            this.d();
            return;
         case 290:
            this.e();
            double var3 = com.aspose.cells.b.a.zc.f(this.d, 0);
            if (var3 >= 0.0D) {
               this.e.s = CellsHelper.getDateTimeFromDouble(var3, this.g.getWorkbook().getSettings().getDate1904());
            }

            int var5 = com.aspose.cells.b.a.zc.e(this.d, 8) & '\uffff';
            if (var5 != 0) {
               this.a(var5);
            }
         }
      }

      if (this.e.n == null) {
         this.e.a(false, 1);
      }

   }

   private void a(int var1) throws Exception {
      zaus var2 = null;
      zbrf var3 = null;
      zbro var4 = null;
      zbqw var5 = null;

      while(true) {
         this.a = this.f.b(this.c);
         switch(this.a) {
         case 10:
         case 199:
         case 200:
            this.f.a(-2);
            return;
         case 240:
            this.e();
            var2.f = var4 = new zbro();
            var4.a = this.d[0];
            var4.b = this.d[1];
            var4.c = com.aspose.cells.b.a.zc.e(this.d, 2);
            break;
         case 242:
            this.e();
            var5 = new zbqw();
            com.aspose.cells.b.a.a.ze.a(var4.e, (Object)var5);
            var5.a = com.aspose.cells.b.a.zc.e(this.d, 0);
            var5.b = com.aspose.cells.b.a.zc.e(this.d, 2);
            var5.a(com.aspose.cells.b.a.zc.e(this.d, 4));
            break;
         case 245:
            this.e();
            if (var5.c == null) {
               var5.c = new ArrayList();
            }

            com.aspose.cells.b.a.a.ze.a(var5.c, (Object)(com.aspose.cells.b.a.zc.e(this.d, 0) & '\uffff'));
            break;
         case 246:
            this.e();
            var3 = new zbrf();
            if (var2.d == null) {
               var2.d = new zbrk();
            }

            var2.d.a(var3);
            var3.a = com.aspose.cells.b.a.zc.e(this.d, 0);
            var3.b = com.aspose.cells.b.a.zc.e(this.d, 2);
            var3.c = com.aspose.cells.b.a.zc.e(this.d, 4);
            break;
         case 248:
            this.e();
            zbrg var7 = new zbrg();
            var3.b().a(var7);
            var7.a = com.aspose.cells.b.a.zc.e(this.d, 0);
            var7.b = com.aspose.cells.b.a.zc.e(this.d, 2);
            var7.c = com.aspose.cells.b.a.zc.e(this.d, 6);
            break;
         case 249:
            this.e();
            var2 = new zaus(this.e);
            if (this.e.v == null) {
               this.e.v = new zaur();
            }

            this.e.v.a(var2);
            int var6 = com.aspose.cells.b.a.zc.e(this.d, 0) & '\uffff';
            var2.c = new byte[var6];
            System.arraycopy(this.d, 4, var2.c, 0, var6);
            break;
         case 259:
            this.e();
            var2.e = com.aspose.cells.b.a.zc.b(this.d, 2);
            break;
         default:
            this.b = this.f.b(this.c);
            this.f.a(this.b & '\uffff');
         }
      }
   }

   void a() throws Exception {
      zbqs var1 = null;

      while(!this.f.a()) {
         this.a = this.f.b(this.c);
         zbmb var2;
         int var4;
         switch(this.a) {
         case 10:
            this.f.a(2);
            return;
         case 199:
            this.e();
            var1 = new zbqs(this.e);
            if (this.e.p == null) {
               this.e.p = new ArrayList();
            }

            com.aspose.cells.b.a.a.ze.a(this.e.p, (Object)var1);
            var1.b = com.aspose.cells.b.a.zc.e(this.d, 0);
            var1.h = com.aspose.cells.b.a.zc.e(this.d, 2) & '\uffff';
            var1.a(com.aspose.cells.b.a.zc.e(this.d, 4) & '\uffff');
            var1.m = com.aspose.cells.b.a.zc.e(this.d, 12) & '\uffff';
            var1.a = zco.a(this.d, 14);
            if (var1.c()) {
               var1.c = new ArrayList();
               var1.e(false);
               if (var1.n()) {
                  SxRng var7 = new SxRng(var1);
                  var1.j = var7;
                  var1.j.d = new ArrayList();
                  if (var1.i != 0) {
                     var1.j.k = var1.i;
                  } else {
                     var1.j.k = var1.w();
                  }

                  if (var1.l()) {
                     var1.j.l = var1.h;
                  }
               }
            }
            break;
         case 200:
            this.f.a(-2);
            this.d();
            break;
         case 201:
            this.e();
            var2 = new zbmb();
            var2.a = com.aspose.cells.b.a.zc.f(this.d, 0);
            if (var1.n()) {
               if (var1.j != null && var1.j.d != null) {
                  com.aspose.cells.b.a.a.ze.a(var1.j.d, (Object)var2);
               }
            } else if (var1.c != null) {
               com.aspose.cells.b.a.a.ze.a(var1.c, (Object)var2);
            }
            break;
         case 202:
            this.e();
            var2 = new zbmb();
            var2.a = this.d[0] != 0;
            if (var1.n()) {
               if (var1.j != null && var1.j.d != null) {
                  com.aspose.cells.b.a.a.ze.a(var1.j.d, (Object)var2);
               }
            } else if (var1.c != null) {
               com.aspose.cells.b.a.a.ze.a(var1.c, (Object)var2);
            }
            break;
         case 203:
            this.e();
            var2 = new zbmb();
            switch(this.d[0]) {
            case 0:
               var2.a = "#NULL!";
               break;
            case 7:
               var2.a = "#DIV/0!";
               break;
            case 15:
               var2.a = "#VALUE!";
               break;
            case 23:
               var2.a = "#REF!";
               break;
            case 29:
               var2.a = "#NAME?";
               break;
            case 36:
               var2.a = "#NUM!";
               break;
            case 42:
               var2.a = "#N/A";
            }

            if (var1.n()) {
               if (var1.j != null && var1.j.d != null) {
                  com.aspose.cells.b.a.a.ze.a(var1.j.d, (Object)var2);
               }
            } else if (var1.c != null) {
               com.aspose.cells.b.a.a.ze.a(var1.c, (Object)var2);
            }
            break;
         case 204:
            this.e();
            var2 = new zbmb();
            var2.a = com.aspose.cells.b.a.zc.b(this.d, 0);
            if (var1.n()) {
               if (var1.j != null && var1.j.d != null) {
                  com.aspose.cells.b.a.a.ze.a(var1.j.d, (Object)var2);
               }
            } else if (var1.c != null) {
               com.aspose.cells.b.a.a.ze.a(var1.c, (Object)var2);
            }
            break;
         case 205:
            this.e();
            String var3 = null;
            if (this.d[2] == 0) {
               var4 = this.d.length - 3;
               byte[] var8 = new byte[var4 * 2];

               for(int var6 = 0; var6 < var4; ++var6) {
                  var8[var6 * 2] = this.d[3 + var6];
               }

               var3 = Encoding.getUnicode().a(var8, 0, var4 * 2);
            } else {
               var3 = Encoding.getUnicode().a(this.d, 3, this.d.length - 3);
            }

            var2 = new zbmb();
            var2.a = var3;
            if (var1.n()) {
               if (var1.j != null && var1.j.d != null) {
                  com.aspose.cells.b.a.a.ze.a(var1.j.d, (Object)var2);
               }
            } else if (var1.c != null) {
               com.aspose.cells.b.a.a.ze.a(var1.c, (Object)var2);
            }

            if (!var1.n()) {
               var1.e(true);
            }
            break;
         case 206:
            this.e();
            var2 = new zbmb();
            var2.a = this.b(this.d, 0);
            if (var1.n()) {
               if (var1.j != null && var1.j.d != null) {
                  com.aspose.cells.b.a.a.ze.a(var1.j.d, (Object)var2);
               }
            } else if (var1.c != null) {
               com.aspose.cells.b.a.a.ze.a(var1.c, (Object)var2);
            }
            break;
         case 207:
            this.e();
            var2 = new zbmb();
            var2.a = null;
            if (var1.n()) {
               if (var1.j != null && var1.j.d != null) {
                  com.aspose.cells.b.a.a.ze.a(var1.j.d, (Object)var2);
               }
            } else if (var1.c != null) {
               com.aspose.cells.b.a.a.ze.a(var1.c, (Object)var2);
            }
            break;
         case 216:
            if (var1.j == null) {
               this.b = this.f.b(this.c);
               this.f.a(this.b & '\uffff');
            } else {
               this.e();
               var1.j.a = (this.d[0] & 255 & 1) != 0;
               var1.j.b = (this.d[0] & 255 & 2) != 0;
               var1.j.c = zavb.c((this.d[0] & 255 & 31) >> 2);
               System.arraycopy(this.d, 0, var1.j.e, 0, 2);
               this.a(var1);
            }
            break;
         case 246:
            this.e();
            zbrf var5 = new zbrf();
            com.aspose.cells.b.a.a.ze.a(var1.f, (Object)var5);
            var5.a = com.aspose.cells.b.a.zc.e(this.d, 0);
            var5.b = com.aspose.cells.b.a.zc.e(this.d, 2);
            var5.c = com.aspose.cells.b.a.zc.e(this.d, 4);
            break;
         case 249:
            this.e();
            var4 = com.aspose.cells.b.a.zc.e(this.d, 0) & '\uffff';
            var1.e = new byte[var4];
            System.arraycopy(this.d, 4, var1.e, 0, var4);
            var1.f = new ArrayList();
            break;
         case 443:
            this.e();
            var1.g = com.aspose.cells.b.a.zc.e(this.d, 0);
            break;
         default:
            this.b = this.f.b(this.c);
            this.f.a(this.b & '\uffff');
         }
      }

   }

   private void a(zbqs var1) throws Exception {
      int var2 = 0;

      while(!this.f.a()) {
         this.a = this.f.b(this.c);
         zbmb var3;
         switch(this.a) {
         case 201:
            this.e();
            var3 = new zbmb();
            var3.a = com.aspose.cells.b.a.zc.f(this.d, 0);
            if (var2 == 0) {
               var1.j.h = (Double)var3.a;
            } else if (var2 == 1) {
               var1.j.i = (Double)var3.a;
            } else if (var2 == 2) {
               var1.j.j = (Double)var3.a;
            } else if (var1.c != null) {
               com.aspose.cells.b.a.a.ze.a(var1.c, (Object)var3);
            }

            ++var2;
            break;
         case 204:
            this.e();
            short var4 = com.aspose.cells.b.a.zc.b(this.d, 0);
            if (var2 == 2) {
               var1.j.j = (double)var4;
            }

            ++var2;
            break;
         case 206:
            this.e();
            var3 = new zbmb();
            var3.a = this.b(this.d, 0);
            if (var2 == 0) {
               var1.j.f = (DateTime)var3.a;
            } else if (var2 == 1) {
               var1.j.g = (DateTime)var3.a;
            } else if (var1.c != null) {
               com.aspose.cells.b.a.a.ze.a(var1.c, (Object)var3);
            }

            ++var2;
            break;
         default:
            this.f.a(-2);
            return;
         }
      }

   }

   private void d() throws Exception {
      zaun var1 = new zaun(this.e);
      this.e.n = var1;
      var1.a();
      int var2 = var1.b();
      int var3 = this.e.i;
      boolean[] var4 = var1.b;
      boolean[] var5 = var1.c;
      int var6 = -1;
      int var7 = 0;

      label108:
      while(!this.f.a()) {
         this.a = this.f.b(this.c);
         switch(this.a) {
         case 10:
            this.f.a(2);
            return;
         case 200:
            var7 = 0;
            ++var6;
            this.e();
            if (var6 >= var1.a.size()) {
               break;
            }

            int var10;
            int var11;
            if ((this.b & '\uffff') == var2) {
               var10 = 0;
               var11 = 0;

               while(true) {
                  if (var11 >= (this.b & '\uffff')) {
                     continue label108;
                  }

                  while(var10 < var3 && !var4[var10]) {
                     ++var10;
                  }

                  ((Object[])((Object[])var1.a.get(var6)))[var10++] = this.d[var11] & 255;
                  ++var11;
               }
            } else {
               var10 = 0;
               var11 = 0;

               for(; var11 < (this.b & '\uffff'); ++var11) {
                  while(var10 < var3 && !var4[var10]) {
                     ++var10;
                  }

                  if (var10 >= var5.length) {
                     continue label108;
                  }

                  if (var5[var10]) {
                     ((Object[])((Object[])var1.a.get(var6)))[var10++] = com.aspose.cells.b.a.zc.e(this.d, var11) & '\uffff';
                     ++var11;
                  } else {
                     ((Object[])((Object[])var1.a.get(var6)))[var10++] = this.d[var11] & 255;
                  }
               }
               break;
            }
         case 201:
         case 202:
         case 205:
         case 206:
         case 207:
            while(var7 < var3 && var4[var7]) {
               ++var7;
            }

            this.e();
            if (var6 < var1.a.size()) {
               Object[] var8 = (Object[])((Object[])var1.a.get(var6));
               if (var7 < var8.length) {
                  switch(this.a) {
                  case 201:
                     var8[var7++] = com.aspose.cells.b.a.zc.f(this.d, 0);
                     continue;
                  case 202:
                     var8[var7++] = this.d[0] != 0;
                  case 203:
                  case 204:
                  default:
                     continue;
                  case 205:
                     String var9 = null;
                     if (this.d[2] == 0) {
                        var9 = Encoding.getASCII().a(this.d, 3, this.d.length - 3);
                     } else {
                        var9 = Encoding.getUnicode().a(this.d, 3, this.d.length - 3);
                     }

                     var8[var7++] = var9;
                     continue;
                  case 206:
                     var8[var7++] = this.b(this.d, 0);
                     continue;
                  case 207:
                     var8[var7++] = null;
                  }
               }
            }
            break;
         default:
            this.b = this.f.b(this.c);
            this.f.a(this.b & '\uffff');
         }
      }

   }

   private void e() throws Exception {
      this.b = this.f.b(this.c);
      if ((this.b & '\uffff') != 0) {
         this.d = new byte[this.b];
         this.f.a(this.d);
      }

   }

   private DateTime b(byte[] var1, int var2) {
      int var3 = com.aspose.cells.b.a.zc.e(this.d, 0 + var2) & '\uffff';
      int var4 = com.aspose.cells.b.a.zc.e(this.d, 2 + var2) & '\uffff';
      byte var5 = this.d[4 + var2];
      new DateTime(1900, 1, 1);
      DateTime var6;
      if (var5 == 0) {
         var6 = CellsHelper.getDateTimeFromDouble(0.0D, false);
      } else {
         byte var7 = this.d[5 + var2];
         byte var8 = this.d[6 + var2];
         byte var9 = this.d[7 + var2];
         var6 = this.a(var3, var4, var5 & 255, var7 & 255, var8 & 255, var9 & 255);
      }

      return var6;
   }

   private boolean b(int var1) {
      return var1 % 4 == 0 && var1 % 100 != 0 || var1 % 400 == 0;
   }

   private DateTime a(int var1, int var2, int var3, int var4, int var5, int var6) {
      switch(var2) {
      case 1:
      case 3:
      case 5:
      case 7:
      case 8:
      case 10:
      case 12:
         var3 = var3 > 31 ? 31 : var3;
         break;
      case 2:
         if (this.b(var1)) {
            var3 = var3 > 29 ? 29 : var3;
         } else {
            var3 = var3 > 28 ? 28 : var3;
         }
         break;
      case 4:
      case 6:
      case 9:
      case 11:
         var3 = var3 > 30 ? 30 : var3;
      }

      var2 = var2 > 12 ? 12 : var2;
      var4 = var4 > 23 ? 23 : var4;
      var5 = var5 > 59 ? 59 : var5;
      var6 = var6 > 59 ? 59 : var6;
      return new DateTime(var1, var2, var3, var4, var5, var6);
   }
}
